package com.ouc.yyi.springcloud.gateway.filter;

import com.ouc.yyi.springcloud.gateway.exception.IllegalTokenException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @description:
 * @author: yyi
 * @date: 2022/12/9 9:07
 * @version: 1.0
 **/
@Component
@Slf4j
public class testFilter implements GlobalFilter, Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        throw new IllegalTokenException("shaodiao");
    }

    @Override
    public int getOrder() {
        return HIGHEST_PRECEDENCE;
    }
}
